﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Data;
using BusinessObjects.BO_GetObjects;

public partial class Controls_ucFeaturedEbook : System.Web.UI.UserControl
{
    private string module_id;

    public string Module_id
    {
        get { return module_id; }
        set { module_id = value; }
    }
    private string page_size;

    public string Page_size
    {
        get { return page_size; }
        set { page_size = value; }
    }
    private string top_image;

    public string Top_image
    {
        get { return top_image; }
        set { top_image = value; }
    }
    protected void Page_Load(object sender, EventArgs e)
    {
        if (!IsPostBack)
        {
            LoadContent();
        }
    }

    protected void LoadContent()
    {
        if (top_image != "")
        {
            iTopModule.Src = "../upload/home/" + top_image;
        }
        else
        {
            iTopModule.Src = "../images/ebook.png";
        }
        DataTable objDT = BO_EBooks.SelectByModule(1, 1, Convert.ToInt32(page_size), Convert.ToInt32(module_id));
        if (objDT.Rows.Count > 0)
        {
            rptContent.DataSource = objDT;
            rptContent.DataBind();
        }
    }
}